from django.shortcuts import render
from rest_framework.response import Response
from rest_framework.views import APIView


# Create your views here.
class Login(APIView):
    def get(self, request, *args, **kwargs):
        username = request.query_params.get('username')
        password = request.query_params.get('password')
        au = request.headers.get('Authorization')
        bo = request.data.get("name")
        hh = request.method
        self.dispatch(),
        self.authorization()
        request.method()
        print(username, password, au, bo, hh)
        return Response({"name": username, "password": password})

    def post(self, request, *args, **kwargs):
        username1 = request.query_params.get('username')
        password1 = request.query_params.get('password')
        au = request.headers.get('Authorization')
        bo = request.data.get("name")
        print(username1, password1, au, bo)
        return Response({"name": username1, "password": password1})



